package com.xxx.orderservice.feignClient;

import com.xxx.util.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

@FeignClient(value = "user-service", path = "/user")
public interface UserServiceFeignClient {

    @PostMapping("/addUser")
    boolean addUser (@RequestBody User user);

    @GetMapping(value = "/deductMoneyByAT")
    boolean deductMoneyByAT (@RequestParam("userId") String userId, @RequestParam("amount") BigDecimal amount);

    @GetMapping(value = "/deductMoneyByTCC")
    boolean deductMoneyByTCC (@RequestParam("userId") String userId, @RequestParam("amount") BigDecimal amount);
}
